﻿using sql_data_generator.FieldOptions;
using sql_data_generator.Generators;

namespace sql_data_generator.Randomizers
{
    public class RandomizerTextRandomLength : BaseRandomizer<FieldOptionsTextRandomLength>, IRandomizer
    {
        private readonly RandomStringGenerator _generator;

        public RandomizerTextRandomLength(FieldOptionsTextRandomLength options)
            : base(options)
        {
            _generator = new RandomStringGenerator(options.UseUppercase, options.UseLowercase, options.UseNumber, options.UseSpecial, options.UseSpace);
        }

        public object GetData()
        {
            return IsNull() ? null : _generator.Generate(Options.Min, Options.Max);
        }
    }
}